package com.ifast.sys.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ifast.sys.dao.UnitBasicinfoDao;
import com.ifast.sys.domain.UnitBasicinfoDO;
import com.ifast.sys.service.UnitBasicinfoService;
import com.ifast.common.base.CoreServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * 
 * <pre>
 * 学校表
 * </pre>
 * <small> 2018-07-23 12:40:29 | com.wondersgroup</small>
 */
@Service
public class UnitBasicinfoServiceImpl extends CoreServiceImpl<UnitBasicinfoDao, UnitBasicinfoDO> implements UnitBasicinfoService {

    @Autowired
    UnitBasicinfoDao unitBasicinfoDao;

    @Override
    public List<UnitBasicinfoDO> selectSchJustIdBsmAndName(Map map) {
        return unitBasicinfoDao.selectSchJustIdBsmAndName(map);
    }

    @Override
    public List<Map<String, Object>> selectIdNameList() {
        Wrapper<UnitBasicinfoDO> wrapper = new EntityWrapper<>();
        wrapper.setSqlSelect("id","xxmc");
        return this.unitBasicinfoDao.selectMaps(wrapper);
    }

    @Override
    public String selectNameById(Long id) {
        String name = null;
        UnitBasicinfoDO unitBasicinfoDO = this.unitBasicinfoDao.selectById(id);
        if (unitBasicinfoDO != null) {
            name = unitBasicinfoDO.getXxmc();
        }
        return name;
    }
}
